<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>addNewManager</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<script type="text/javascript">
function checkReg(){
	var name=document.getElementById("name");
	var email=document.getElementById("email");
	var passwd=document.getElementById("passwd");
	var passwd1=document.getElementById("passwd1");
	var pattern = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/; 
	if(name.value==""){
		alert("姓名不能为空");
		return false;
	}else if(email.value==""){
		alert("邮箱不能为空");
		return false;
	}else if(!pattern.test(email.value)){
		alert("邮箱格式不正确，请重新填写");
		email.value="";
		return false;
	}else if(passwd.value==""){
		alert("密码不能为空");
		return false;
	}else if(passwd1.value==""){
		alert("确认密码不能为空");
		return false;
	}else if(passwd.value!=passwd1.value){
		alert("两次密码输入不一致，请重新输入");
		passwd.value="";
		passwd1.value="";
		return false;
	}else{
		return true;
	}
}
</script>
</head>
<body>
<div id="detailmanager">
<a href="javascript:history.back(-1);"><img src="<%=basePath%>images/goBack.png"/></a>
</div>
	<form method="post" onsubmit="return checkReg()" action="<%=basePath%>servlet/ManagerServlet?m=AddNewManager">
		<table style="border-collapse:separate; border-spacing:10px;">
			<tr>
				<td>普通管理员姓名:</td>
				<td><input type="text" name="name" id="name"/></td>
				<td><p style="color: red;">*</p></td>
			</tr>
			<tr>
				<td>普通管理员年龄:</td>
				<td><input type="text" name="age" id="age"/></td>
			</tr>
			<tr>
				<td>普通管理员电话:</td>
				<td><input type="text" name="tel" id="tel"/></td>
			</tr>
			<tr>
				<td>普通管理员密码:</td>
				<td><input type="password" name="passwd" id="passwd" /></td>
				<td><p style="color: red;">*</p></td>
			</tr>
			<tr>
				<td>普通管理员确认密码:</td>
				<td><input type="password" name="passwd1" id="passwd1"/></td>
				<td><p style="color: red;">*</p></td>
			</tr>
			<tr>
				<td>普通管理员邮箱:</td>
				<td><input type="text" name="email" id="email"/></td>
				<td><p style="color: red;">*</p></td>
			</tr>
			
			<tr>
				<td>是否分配管理用户权限:</td>
				<td><select name="umanager">
				<option>是</option>
				<option>否</option>
				</select></td>
			</tr>
			<tr>
				<td>是否分配管理指导信息权限:</td>
				<td><select name="gmanager">
				<option>是</option>
				<option>否</option>
				</select></td>
			</tr>
			<tr>
				<td>是否分配管理广告权限:</td>
				<td><select name="amanager">
				<option>是</option>
				<option>否</option>
				</select></td>
			</tr>
			<tr>
				<td>是否分配管理论坛权限:</td>
				<td><select name="bmanager">
				<option>是</option>
				<option>否</option>
				</select></td>
			</tr>
			<tr>
				<td>是否分配管理人才权限:</td>
				<td><select name="rmanager">
				<option>是</option>
				<option>否</option>
				</select></td>
			</tr>
			<tr>
				<td>是否分配管理新闻权限:</td>
				<td><select name="rmanager">
				<option>是</option>
				<option>否</option>
				</select></td>
			</tr>
			<tr>
				<td><input type="submit" value="添加" /></td>
			</tr>
		</table>

	</form>
</body>
</html>
